package Game 
{
	import flash.display.Sprite;
	import flash.geom.Matrix;
	import flash.geom.Point;
	
	/**
	 * ...
	 * @author Vijay Ramani
	 */
	public class GameEntity extends Sprite 
	{
		public static const TYPE_NONE:uint = 0;
		public static const TYPE_PELLET:uint = 1;
		public static const TYPE_SHIP:uint = 2;
		
		private var worldRef:MainGame = null;
		private var sectorRef:Sector = null;
		
		private var pos:Point = new Point();
		private var lastPos:Point = new Point();
		
		private var type:uint = 0;
		private var energyValue:uint = 0;
		
		public function GameEntity(_type:uint = 0) 
		{
			super();
			type = _type;
			this.cacheAsBitmap = true;
			//this.cacheAsBitmapMatrix = new Matrix();
		}
		
		public function Update():void
		{
			lastPos = pos.clone();
			Sector.UpdateSectors(this);
		}
		
		public function get Pos():Point
		{
			return pos;
		}
		public function set Pos(_value:Point):void
		{
			pos = _value;
		}
		
		public function set WorldRef(_value:MainGame):void
		{
			worldRef = _value;
		}
		
		public function get WorldRef():MainGame
		{
			return worldRef;
		}
		
		public function set SectorRef(_value:Sector):void
		{
			sectorRef = _value;
		}
		public function get SectorRef():Sector
		{
			return sectorRef;
		}
		public function get Type():uint
		{
			return type;
		}
		public function get EnergyValue():uint
		{
			return energyValue;
		}
		public function set EnergyValue(_value:uint):void
		{
			energyValue = _value;
		}
	}

}